
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2490. --   Zombie’s Treasure Chest  -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2490:   Zombie’s Treasure Chest </h2><span class=green>Time Limit: </span>1 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>36&nbsp;&nbsp;<span class=green>Solved: </span>17<br>[<a href='submitpage.php?id=2490'>Submit</a>][<a href='problemstatus.php?id=2490'>Status</a>][<a href='bbs.php?id=2490'>Discuss</a>]</center><h2>Description</h2><div class=content><p><span style="font-size: medium">Some brave warriors come to a lost village. They are very lucky and find a lot <br />
of treasures and a big treasure chest, but with angry zombies. <br />
The warriors are so brave that they decide to defeat the zombies and then <br />
bring all the treasures back. A brutal long-drawn-out battle lasts from morning to <br />
night and the warriors find the zombies are undead and invincible. <br />
Of course, the treasures should not be left here. Unfortunately, the warriors <br />
cannot carry all the treasures by&nbsp; the treasure chest due to the&nbsp; limitation of&nbsp; the <br />
capacity of the chest. Indeed, there are only two types of treasures: emerald and <br />
sapphire.&nbsp; All&nbsp; of&nbsp; the emeralds&nbsp; are equal in size and value, and with infinite <br />
quantities. So are sapphires. <br />
Being the priest of the warriors with the magic artifact: computer, and given <br />
the size of the chest, the value and size of each types of gem, you should compute <br />
the maximum value of treasures our warriors could bring back. </span></p></div><h2>Input</h2><div class=content><p><span style="font-size: medium">&nbsp; There are multiple test cases. The number of test cases T (T &lt;= 200) is given <br />
in the first line of the input file.&nbsp; For&nbsp; each test case,&nbsp; there&nbsp; is&nbsp; only one line <br />
containing five integers N, S1, V1, S2, V2, denoting the size of the treasure chest is <br />
N and the size and value of an emerald is S1 and V1, size and value of a sapphire <br />
is S2, V2. All integers are positive and fit in 32-bit signed integers. </span></p>
<p><span style="font-size: medium"><!--StartFragment -->
<div>有两种宝石和一个箱子，宝石有体积S和价值V，箱子有容量N，求怎样使箱子中的宝石价值最大（所有数据是正数且范围在32位有符号正数范围内）</div>
</span></p></div><h2>Output</h2><div class=content><p><span style="font-size: medium">&nbsp; For each test case, output a single line containing&nbsp; the case number and the <br />
maximum total value of all items that the warriors can carry with the chest. </span></p></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>2 <br />
100 1 1 2 2 <br />
100 34 34 5 3 <br />
 </span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>Case #1: 100 <br />
Case #2: 86 </span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Acm 2011 上海'>Acm 2011 上海</a></p></div><center>[<a href='submitpage.php?id=2490'>Submit</a>][<a href='problemstatus.php?id=2490'>Status</a>][<a href='bbs.php?id=2490'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
